<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Main loop and Events</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 2 Reference Manual">
<link rel="up" href="gtkbase.html" title="Part II. GTK+ Core Reference">
<link rel="prev" href="gtkbase.html" title="Part II. GTK+ Core Reference">
<link rel="next" href="gtk-Keyboard-Accelerators.html" title="Accelerator Groups">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gtkbase.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="gtkbase.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 2 Reference Manual</th>
<td><a accesskey="n" href="gtk-Keyboard-Accelerators.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk-General.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gtk-General.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gtk-General"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk-General.top_of_page"></a>Main loop and Events</span></h2>
<p>Main loop and Events — Library initialization, main event loop, and events</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk-General.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             <a class="link" href="gtk-General.html#gtk-set-locale" title="gtk_set_locale ()">gtk_set_locale</a>                      (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-disable-setlocale" title="gtk_disable_setlocale ()">gtk_disable_setlocale</a>               (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="/usr/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage"><span class="returnvalue">PangoLanguage</span></a> *     <a class="link" href="gtk-General.html#gtk-get-default-language" title="gtk_get_default_language ()">gtk_get_default_language</a>            (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk-General.html#gtk-parse-args" title="gtk_parse_args ()">gtk_parse_args</a>                      (<em class="parameter"><code><span class="type">int</span> *argc</code></em>,
                                                         <em class="parameter"><code><span class="type">char</span> ***argv</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()">gtk_init</a>                            (<em class="parameter"><code><span class="type">int</span> *argc</code></em>,
                                                         <em class="parameter"><code><span class="type">char</span> ***argv</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()">gtk_init_check</a>                      (<em class="parameter"><code><span class="type">int</span> *argc</code></em>,
                                                         <em class="parameter"><code><span class="type">char</span> ***argv</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk-General.html#gtk-init-with-args" title="gtk_init_with_args ()">gtk_init_with_args</a>                  (<em class="parameter"><code><span class="type">int</span> *argc</code></em>,
                                                         <em class="parameter"><code><span class="type">char</span> ***argv</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *parameter_string</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionEntry"><span class="type">GOptionEntry</span></a> *entries</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *translation_domain</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *      <a class="link" href="gtk-General.html#gtk-get-option-group" title="gtk_get_option_group ()">gtk_get_option_group</a>                (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> open_default_display</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-exit" title="gtk_exit ()">gtk_exit</a>                            (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> error_code</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk-General.html#gtk-events-pending" title="gtk_events_pending ()">gtk_events_pending</a>                  (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-main" title="gtk_main ()">gtk_main</a>                            (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="gtk-General.html#gtk-main-level" title="gtk_main_level ()">gtk_main_level</a>                      (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-main-quit" title="gtk_main_quit ()">gtk_main_quit</a>                       (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk-General.html#gtk-main-iteration" title="gtk_main_iteration ()">gtk_main_iteration</a>                  (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk-General.html#gtk-main-iteration-do" title="gtk_main_iteration_do ()">gtk_main_iteration_do</a>               (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> blocking</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-main-do-event" title="gtk_main_do_event ()">gtk_main_do_event</a>                   (<em class="parameter"><code><a href="../gdk/gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>);
<span class="returnvalue">void</span>                (<a class="link" href="gtk-General.html#GtkModuleInitFunc" title="GtkModuleInitFunc ()">*GtkModuleInitFunc</a>)                (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *argc</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> ***argv</code></em>);
<span class="returnvalue">void</span>                (<a class="link" href="gtk-General.html#GtkModuleDisplayInitFunc" title="GtkModuleDisplayInitFunc ()">*GtkModuleDisplayInitFunc</a>)         (<em class="parameter"><code><a href="../gdk/GdkDisplay.html"><span class="type">GdkDisplay</span></a> *display</code></em>);

<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk-General.html#gtk-true" title="gtk_true ()">gtk_true</a>                            (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk-General.html#gtk-false" title="gtk_false ()">gtk_false</a>                           (<em class="parameter"><code><span class="type">void</span></code></em>);

<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-grab-add" title="gtk_grab_add ()">gtk_grab_add</a>                        (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk-General.html#gtk-grab-get-current" title="gtk_grab_get_current ()">gtk_grab_get_current</a>                (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-grab-remove" title="gtk_grab_remove ()">gtk_grab_remove</a>                     (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);

<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-init-add" title="gtk_init_add ()">gtk_init_add</a>                        (<em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-quit-add-destroy" title="gtk_quit_add_destroy ()">gtk_quit_add_destroy</a>                (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> main_level</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="gtk-General.html#gtk-quit-add" title="gtk_quit_add ()">gtk_quit_add</a>                        (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> main_level</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="gtk-General.html#gtk-quit-add-full" title="gtk_quit_add_full ()">gtk_quit_add_full</a>                   (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> main_level</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()"><span class="type">GtkCallbackMarshal</span></a> marshal</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-quit-remove" title="gtk_quit_remove ()">gtk_quit_remove</a>                     (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> quit_handler_id</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-quit-remove-by-data" title="gtk_quit_remove_by_data ()">gtk_quit_remove_by_data</a>             (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);

<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="gtk-General.html#gtk-timeout-add-full" title="gtk_timeout_add_full ()">gtk_timeout_add_full</a>                (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> interval</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()"><span class="type">GtkCallbackMarshal</span></a> marshal</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="gtk-General.html#gtk-timeout-add" title="gtk_timeout_add ()">gtk_timeout_add</a>                     (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> interval</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-timeout-remove" title="gtk_timeout_remove ()">gtk_timeout_remove</a>                  (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> timeout_handler_id</code></em>);

<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="gtk-General.html#gtk-idle-add" title="gtk_idle_add ()">gtk_idle_add</a>                        (<em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="gtk-General.html#gtk-idle-add-priority" title="gtk_idle_add_priority ()">gtk_idle_add_priority</a>               (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> priority</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="gtk-General.html#gtk-idle-add-full" title="gtk_idle_add_full ()">gtk_idle_add_full</a>                   (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> priority</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()"><span class="type">GtkCallbackMarshal</span></a> marshal</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-idle-remove" title="gtk_idle_remove ()">gtk_idle_remove</a>                     (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> idle_handler_id</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-idle-remove-by-data" title="gtk_idle_remove_by_data ()">gtk_idle_remove_by_data</a>             (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);

<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="gtk-General.html#gtk-input-add-full" title="gtk_input_add_full ()">gtk_input_add_full</a>                  (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> source</code></em>,
                                                         <em class="parameter"><code><a href="../gdk/gdk-Input.html#GdkInputCondition"><span class="type">GdkInputCondition</span></a> condition</code></em>,
                                                         <em class="parameter"><code><a href="../gdk/gdk-Input.html#GdkInputFunction"><span class="type">GdkInputFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()"><span class="type">GtkCallbackMarshal</span></a> marshal</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-input-remove" title="gtk_input_remove ()">gtk_input_remove</a>                    (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> input_handler_id</code></em>);

#define             <a class="link" href="gtk-General.html#GTK-PRIORITY-REDRAW:CAPS" title="GTK_PRIORITY_REDRAW">GTK_PRIORITY_REDRAW</a>
#define             <a class="link" href="gtk-General.html#GTK-PRIORITY-RESIZE:CAPS" title="GTK_PRIORITY_RESIZE">GTK_PRIORITY_RESIZE</a>
#define             <a class="link" href="gtk-General.html#GTK-PRIORITY-HIGH:CAPS" title="GTK_PRIORITY_HIGH">GTK_PRIORITY_HIGH</a>
#define             <a class="link" href="gtk-General.html#GTK-PRIORITY-INTERNAL:CAPS" title="GTK_PRIORITY_INTERNAL">GTK_PRIORITY_INTERNAL</a>
#define             <a class="link" href="gtk-General.html#GTK-PRIORITY-DEFAULT:CAPS" title="GTK_PRIORITY_DEFAULT">GTK_PRIORITY_DEFAULT</a>
#define             <a class="link" href="gtk-General.html#GTK-PRIORITY-LOW:CAPS" title="GTK_PRIORITY_LOW">GTK_PRIORITY_LOW</a>

<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="gtk-General.html#gtk-key-snooper-install" title="gtk_key_snooper_install ()">gtk_key_snooper_install</a>             (<em class="parameter"><code><a class="link" href="gtk-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()"><span class="type">GtkKeySnoopFunc</span></a> snooper</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> func_data</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                (<a class="link" href="gtk-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()">*GtkKeySnoopFunc</a>)                  (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *grab_widget</code></em>,
                                                         <em class="parameter"><code><a href="../gdk/gdk-Event-Structures.html#GdkEventKey"><span class="type">GdkEventKey</span></a> *event</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> func_data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-key-snooper-remove" title="gtk_key_snooper_remove ()">gtk_key_snooper_remove</a>              (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> snooper_handler_id</code></em>);

<a href="../gdk/gdk-Event-Structures.html#GdkEvent"><span class="returnvalue">GdkEvent</span></a> *          <a class="link" href="gtk-General.html#gtk-get-current-event" title="gtk_get_current_event ()">gtk_get_current_event</a>               (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a>             <a class="link" href="gtk-General.html#gtk-get-current-event-time" title="gtk_get_current_event_time ()">gtk_get_current_event_time</a>          (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk-General.html#gtk-get-current-event-state" title="gtk_get_current_event_state ()">gtk_get_current_event_state</a>         (<em class="parameter"><code><a href="../gdk/gdk-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> *state</code></em>);
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk-General.html#gtk-get-event-widget" title="gtk_get_event_widget ()">gtk_get_event_widget</a>                (<em class="parameter"><code><a href="../gdk/gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-General.html#gtk-propagate-event" title="gtk_propagate_event ()">gtk_propagate_event</a>                 (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
                                                         <em class="parameter"><code><a href="../gdk/gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gtk-General.description"></a><h2>Description</h2>
<p>
Before using GTK+, you need to initialize it; initialization connects
to the window system display, and parses some standard command line
arguments. The <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> function initializes GTK+. <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> exits
the application if errors occur; to avoid this, use <a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>.
<a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a> allows you to recover from a failed GTK+
initialization - you might start up your application in text mode instead.
</p>
<p>
Like all GUI toolkits, GTK+ uses an event-driven programming
model. When the user is doing nothing, GTK+ sits in the
<em class="firstterm">main loop</em> and waits for input. If the user
performs some action - say, a mouse click - then the main loop "wakes
up" and delivers an event to GTK+. GTK+ forwards the event to one or
more widgets.
</p>
<p>
When widgets receive an event, they frequently emit one or more
<em class="firstterm">signals</em>. Signals notify your program that
"something interesting happened" by invoking functions you've
connected to the signal with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect"><code class="function">g_signal_connect()</code></a>. Functions connected
to a signal are often termed <em class="firstterm">callbacks</em>.
</p>
<p>
When your callbacks are invoked, you would typically take some action
- for example, when an Open button is clicked you might display a
<span class="type">GtkFileSelectionDialog</span>. After a callback finishes, GTK+ will return
to the main loop and await more user input.
</p>
<div class="example">
<a name="id483344"></a><p class="title"><b>Example 2. Typical <code class="function">main</code> function for a GTK+ application</b></p>
<div class="example-contents">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="type">int</span>
<span class="function">main</span><span class="normal"> </span><span class="symbol">(</span><span class="type">int</span><span class="normal"> argc</span><span class="symbol">,</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">**</span><span class="normal">argv</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="comment">/* Initialize i18n support */</span>
<span class="normal">  </span><span class="function"><a href="gtk-General.html#gtk-set-locale">gtk_set_locale</a></span><span class="normal"> </span><span class="symbol">();</span>
<span class="normal">  </span><span class="comment">/* Initialize the widget set */</span>
<span class="normal">  </span><span class="function"><a href="gtk-General.html#gtk-init">gtk_init</a></span><span class="normal"> </span><span class="symbol">(&amp;</span><span class="normal">argc</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">argv</span><span class="symbol">);</span>
<span class="normal">  </span><span class="comment">/* Create the main window */</span>
<span class="normal">  mainwin </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkWindow.html#gtk-window-new">gtk_window_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="gtk-Standard-Enumerations.html#GTK-WINDOW-TOPLEVEL:CAPS">GTK_WINDOW_TOPLEVEL</a></span><span class="symbol">);</span>
<span class="normal">  </span><span class="comment">/* Set up our GUI elements */</span>
<span class="normal">  </span><span class="symbol">...</span>
<span class="normal">  </span><span class="comment">/* Show the application window */</span>
<span class="normal">  </span><span class="function"><a href="GtkWidget.html#gtk-widget-show-all">gtk_widget_show_all</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">mainwin</span><span class="symbol">);</span>
<span class="normal">  </span><span class="comment">/* Enter the main event loop, and wait for user interaction */</span>
<span class="normal">  </span><span class="function"><a href="gtk-General.html#gtk-main">gtk_main</a></span><span class="normal"> </span><span class="symbol">();</span>
<span class="normal">  </span><span class="comment">/* The user lost interest */</span>
<span class="normal">  </span><span class="keyword">return</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span>
<span class="cbracket">}</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

</div>
<br class="example-break"><p>
It's OK to use the GLib main loop directly instead of <a class="link" href="gtk-General.html#gtk-main" title="gtk_main ()"><code class="function">gtk_main()</code></a>,
though it involves slightly more typing. See <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a> in the GLib
documentation.
</p>
</div>
<div class="refsect1">
<a name="gtk-General.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="gtk-set-locale"></a><h3>gtk_set_locale ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             gtk_set_locale                      (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_set_locale</code> has been deprecated since version 2.24 and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/glib/unstable/glib-running.html#setlocale"><code class="function">setlocale()</code></a> directly</p>
</div>
<p>
Initializes internationalization support for GTK+. <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>
automatically does this, so there is typically no point
in calling this function.
</p>
<p>
If you are calling this function because you changed the locale
after GTK+ is was initialized, then calling this function
may help a bit. (Note, however, that changing the locale
after GTK+ is initialized may produce inconsistent results and
is not really supported.)
</p>
<p>
In detail - sets the current locale according to the
program environment. This is the same as calling the C library function
<code class="literal">setlocale (LC_ALL, "")</code> but also takes care of the 
locale specific setup of the windowing system used by GDK.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a string corresponding to the locale set, typically in the
form lang_COUNTRY, where lang is an ISO-639 language code, and
COUNTRY is an ISO-3166 country code. On Unix, this form matches the
result of the <a href="http://library.gnome.org/devel/glib/unstable/glib-running.html#setlocale"><code class="function">setlocale()</code></a>; it is also used on other machines, such as
Windows, where the C library returns a different result. The string is
owned by GTK+ and should not be modified or freed.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-disable-setlocale"></a><h3>gtk_disable_setlocale ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_disable_setlocale               (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Prevents <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>, <a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>, <a class="link" href="gtk-General.html#gtk-init-with-args" title="gtk_init_with_args ()"><code class="function">gtk_init_with_args()</code></a> and
<a class="link" href="gtk-General.html#gtk-parse-args" title="gtk_parse_args ()"><code class="function">gtk_parse_args()</code></a> from automatically
calling <code class="literal">setlocale (LC_ALL, "")</code>. You would
want to use this function if you wanted to set the locale for
your program to something other than the user's locale, or if
you wanted to set different values for different locale categories.
</p>
<p>
Most programs should not need to call this function.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-get-default-language"></a><h3>gtk_get_default_language ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage"><span class="returnvalue">PangoLanguage</span></a> *     gtk_get_default_language            (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Returns the <a href="/usr/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage"><span class="type">PangoLanguage</span></a> for the default language currently in
effect. (Note that this can change over the life of an
application.)  The default language is derived from the current
locale. It determines, for example, whether GTK+ uses the
right-to-left or left-to-right text direction.
</p>
<p>
This function is equivalent to <a href="/usr/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#pango-language-get-default"><code class="function">pango_language_get_default()</code></a>.  See
that function for details.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the default language as a <a href="/usr/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage"><span class="type">PangoLanguage</span></a>, must not be
freed</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-parse-args"></a><h3>gtk_parse_args ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_parse_args                      (<em class="parameter"><code><span class="type">int</span> *argc</code></em>,
                                                         <em class="parameter"><code><span class="type">char</span> ***argv</code></em>);</pre>
<p>
Parses command line arguments, and initializes global
attributes of GTK+, but does not actually open a connection
to a display. (See <a href="../gdk/GdkDisplay.html#gdk-display-open"><code class="function">gdk_display_open()</code></a>, <a href="../gdk/gdk-General.html#gdk-get-display-arg-name"><code class="function">gdk_get_display_arg_name()</code></a>)
</p>
<p>
Any arguments used by GTK+ or GDK are removed from the array and
<em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em> are updated accordingly.
</p>
<p>
There is no need to call this function explicitely if you are using
<a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>, or <a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
<td>a pointer to the number of command line arguments. <span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td>a pointer to the array of
command line arguments. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc][<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if initialization succeeded, otherwise <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-init"></a><h3>gtk_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_init                            (<em class="parameter"><code><span class="type">int</span> *argc</code></em>,
                                                         <em class="parameter"><code><span class="type">char</span> ***argv</code></em>);</pre>
<p>
Call this function before using any other GTK+ functions in your GUI
applications.  It will initialize everything needed to operate the
toolkit and parses some standard command line options.
</p>
<p>
<em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em> are adjusted accordingly so your own code will
never see those standard arguments.
</p>
<p>
Note that there are some alternative ways to initialize GTK+:
if you are calling <a class="link" href="gtk-General.html#gtk-parse-args" title="gtk_parse_args ()"><code class="function">gtk_parse_args()</code></a>, <a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>,
<a class="link" href="gtk-General.html#gtk-init-with-args" title="gtk_init_with_args ()"><code class="function">gtk_init_with_args()</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#g-option-context-parse"><code class="function">g_option_context_parse()</code></a> with
the option group returned by <a class="link" href="gtk-General.html#gtk-get-option-group" title="gtk_get_option_group ()"><code class="function">gtk_get_option_group()</code></a>,
you <span class="emphasis"><em>don't</em></span> have to call <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>.
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
This function will terminate your program if it was unable to
initialize the windowing system for some reason. If you want
your program to fall back to a textual interface you want to
call <a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a> instead.
</p>
</div>
<p>
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
Since 2.18, GTK+ calls <code class="literal">signal (SIGPIPE, SIG_IGN)</code>
during initialization, to ignore SIGPIPE signals, since these are
almost never wanted in graphical applications. If you do need to
handle SIGPIPE for some reason, reset the handler after <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>,
but notice that other libraries (e.g. libdbus or gvfs) might do
similar things.
</p>
</div>
<p>
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
</p>
</div>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
<td>Address of the <em class="parameter"><code>argc</code></em> parameter of
your <code class="function">main()</code> function. Changed if any arguments were handled. <span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td>Address of the
<em class="parameter"><code>argv</code></em> parameter of <code class="function">main()</code>. Any options
understood by GTK+ are stripped before return. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc][<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-init-check"></a><h3>gtk_init_check ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_init_check                      (<em class="parameter"><code><span class="type">int</span> *argc</code></em>,
                                                         <em class="parameter"><code><span class="type">char</span> ***argv</code></em>);</pre>
<p>
This function does the same work as <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> with only
a single change: It does not terminate the program if the GUI can't be
initialized. Instead it returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on failure.
</p>
<p>
This way the application can fall back to some other means of communication 
with the user - for example a curses or command line interface.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
<td>Address of the <em class="parameter"><code>argc</code></em> parameter of your
<code class="function">main()</code> function. Changed if any arguments were handled. <span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td>Address of the <em class="parameter"><code>argv</code></em> parameter of <code class="function">main()</code>.
Any parameters understood by <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> are stripped before return. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc][<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the GUI has been successfully initialized,
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-init-with-args"></a><h3>gtk_init_with_args ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_init_with_args                  (<em class="parameter"><code><span class="type">int</span> *argc</code></em>,
                                                         <em class="parameter"><code><span class="type">char</span> ***argv</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *parameter_string</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionEntry"><span class="type">GOptionEntry</span></a> *entries</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *translation_domain</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
This function does the same work as <a class="link" href="gtk-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>. 
Additionally, it allows you to add your own commandline options, 
and it automatically generates nicely formatted 
<code class="option">--help</code> output. Note that your program will
be terminated after writing out the help output.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
<td>a pointer to the number of command line arguments.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td>a pointer to the array of
command line arguments. <span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>parameter_string</code></em> :</span></p></td>
<td>a string which is displayed in
the first line of <code class="option">--help</code> output, after
<code class="literal"><em class="replaceable"><code>programname</code></em> [OPTION...]</code>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>entries</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated array
of <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionEntry"><span class="type">GOptionEntry</span></a>s describing the options of your program. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>translation_domain</code></em> :</span></p></td>
<td>a translation domain to use for translating
the <code class="option">--help</code> output for the options in <em class="parameter"><code>entries</code></em>
with <code class="function">gettext()</code>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>a return location for errors</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the GUI has been successfully initialized,
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-get-option-group"></a><h3>gtk_get_option_group ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *      gtk_get_option_group                (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> open_default_display</code></em>);</pre>
<p>
Returns a <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> for the commandline arguments recognized
by GTK+ and GDK. You should add this group to your <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a> 
with <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#g-option-context-add-group"><code class="function">g_option_context_add_group()</code></a>, if you are using 
<a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#g-option-context-parse"><code class="function">g_option_context_parse()</code></a> to parse your commandline arguments.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>open_default_display</code></em> :</span></p></td>
<td>whether to open the default display
when parsing the commandline arguments</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> for the commandline arguments recognized
by GTK+</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-exit"></a><h3>gtk_exit ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_exit                            (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> error_code</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_exit</code> is deprecated and should not be used in newly-written code. Use the standard <code class="function">exit()</code> function instead.</p>
</div>
<p>
Terminates the program and returns the given exit code to the caller.
This function will shut down the GUI and free all resources allocated
for GTK+.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>error_code</code></em> :</span></p></td>
<td>Return value to pass to the caller. This is dependent on the
target system but at least on Unix systems <code class="literal">0</code> means success.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-events-pending"></a><h3>gtk_events_pending ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_events_pending                  (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Checks if any events are pending. This can be used to update the GUI
and invoke timeouts etc. while doing some time intensive computation.
</p>
<div class="example">
<a name="id500918"></a><p class="title"><b>Example 3. Updating the GUI during a long computation.</b></p>
<div class="example-contents">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="comment">/* computation going on */</span>
<span class="symbol">...</span>
<span class="normal">        </span><span class="keyword">while</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="gtk-General.html#gtk-events-pending">gtk_events_pending</a></span><span class="normal"> </span><span class="symbol">())</span>
<span class="normal">  </span><span class="function"><a href="gtk-General.html#gtk-main-iteration">gtk_main_iteration</a></span><span class="normal"> </span><span class="symbol">();</span>
<span class="symbol">...</span>
<span class="comment">/* computation continued */</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

</div>
<br class="example-break"><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if any events are pending, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-main"></a><h3>gtk_main ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_main                            (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Runs the main loop until <a class="link" href="gtk-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> is called. You can nest calls to
<a class="link" href="gtk-General.html#gtk-main" title="gtk_main ()"><code class="function">gtk_main()</code></a>. In that case <a class="link" href="gtk-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> will make the innermost invocation
of the main loop return.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-main-level"></a><h3>gtk_main_level ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_main_level                      (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Asks for the current nesting level of the main loop. This can be useful
when calling <a class="link" href="gtk-General.html#gtk-quit-add" title="gtk_quit_add ()"><code class="function">gtk_quit_add()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the nesting level of the current invocation of the main loop.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-main-quit"></a><h3>gtk_main_quit ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_main_quit                       (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Makes the innermost invocation of the main loop return when it regains
control.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-main-iteration"></a><h3>gtk_main_iteration ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_main_iteration                  (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Runs a single iteration of the mainloop. If no events are waiting to be
processed GTK+ will block until the next event is noticed. If you don't
want to block look at <a class="link" href="gtk-General.html#gtk-main-iteration-do" title="gtk_main_iteration_do ()"><code class="function">gtk_main_iteration_do()</code></a> or check if any events are
pending with <a class="link" href="gtk-General.html#gtk-events-pending" title="gtk_events_pending ()"><code class="function">gtk_events_pending()</code></a> first.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <a class="link" href="gtk-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> has been called for the innermost mainloop.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-main-iteration-do"></a><h3>gtk_main_iteration_do ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_main_iteration_do               (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> blocking</code></em>);</pre>
<p>
Runs a single iteration of the mainloop. If no events are available either
return or block dependent on the value of <em class="parameter"><code>blocking</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>blocking</code></em> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if you want GTK+ to block if no events are pending.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <a class="link" href="gtk-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> has been called for the innermost mainloop.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-main-do-event"></a><h3>gtk_main_do_event ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_main_do_event                   (<em class="parameter"><code><a href="../gdk/gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>);</pre>
<p>
Processes a single GDK event. This is public only to allow filtering of events
between GDK and GTK+. You will not usually need to call this function directly.
</p>
<p>
While you should not call this function directly, you might want to know
how exactly events are handled. So here is what this function does with
the event:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><p>
  Compress enter/leave notify events. If the event passed build an
  enter/leave pair together with the next event (peeked from GDK)
  both events are thrown away. This is to avoid a backlog of (de-)highlighting
  widgets crossed by the pointer.
</p></li>
<li class="listitem"><p>
  Find the widget which got the event. If the widget can't be determined
  the event is thrown away unless it belongs to a INCR transaction. In that
  case it is passed to <code class="function">gtk_selection_incr_event()</code>.
</p></li>
<li class="listitem"><p>
  Then the event is passed on a stack so you can query the currently handled
  event with <a class="link" href="gtk-General.html#gtk-get-current-event" title="gtk_get_current_event ()"><code class="function">gtk_get_current_event()</code></a>.
</p></li>
<li class="listitem">
<p>
  The event is sent to a widget. If a grab is active all events for
  widgets that are not in the contained in the grab widget are sent to the
  latter with a few exceptions:
  </p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
    Deletion and destruction events are still sent to the event widget for
    obvious reasons.
  </p></li>
<li class="listitem"><p>
    Events which directly relate to the visual representation of the event
    widget.
  </p></li>
<li class="listitem"><p>
    Leave events are delivered to the event widget if there was an enter
    event delivered to it before without the paired leave event.
  </p></li>
<li class="listitem"><p>
    Drag events are not redirected because it is unclear what the semantics
    of that would be.
  </p></li>
</ul></div>
<p>
  Another point of interest might be that all key events are first passed
  through the key snooper functions if there are any. Read the description
  of <a class="link" href="gtk-General.html#gtk-key-snooper-install" title="gtk_key_snooper_install ()"><code class="function">gtk_key_snooper_install()</code></a> if you need this feature.
</p>
</li>
<li class="listitem"><p>
  After finishing the delivery the event is popped from the event stack.
</p></li>
</ol></div>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td>
<td>An event to process (normally) passed by GDK.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GtkModuleInitFunc"></a><h3>GtkModuleInitFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*GtkModuleInitFunc)                (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *argc</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> ***argv</code></em>);</pre>
<p>
Each GTK+ module must have a function <code class="function">gtk_module_init()</code> with this prototype.
This function is called after loading the module with the <em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em>
cleaned from any arguments that GTK+ handles itself.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
<td>Pointer to the number of arguments remaining after <a class="link" href="gtk-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td>Points to the argument vector.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GtkModuleDisplayInitFunc"></a><h3>GtkModuleDisplayInitFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*GtkModuleDisplayInitFunc)         (<em class="parameter"><code><a href="../gdk/GdkDisplay.html"><span class="type">GdkDisplay</span></a> *display</code></em>);</pre>
<p>
</p>
<p class="since">Since 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-true"></a><h3>gtk_true ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_true                            (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
All this function does it to return <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>. This can be useful for example
if you want to inhibit the deletion of a window. Of course you should
not do this as the user expects a reaction from clicking the close
icon of the window...
</p>
<div class="example">
<a name="id501839"></a><p class="title"><b>Example 4. A persistent window</b></p>
<div class="example-contents">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="preproc">#</span><span class="normal">#include </span><span class="symbol">&lt;</span><span class="normal">gtk</span><span class="symbol">/</span><span class="normal">gtk</span><span class="symbol">.</span><span class="normal">h</span><span class="symbol">&gt;</span>
<span class="type">int</span>
<span class="function">main</span><span class="normal"> </span><span class="symbol">(</span><span class="type">int</span><span class="normal"> argc</span><span class="symbol">,</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">**</span><span class="normal">argv</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="usertype">GtkWidget</span><span class="normal">     </span><span class="symbol">*</span><span class="normal">win</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">but</span><span class="symbol">;</span>
<span class="normal">  </span><span class="function"><a href="gtk-General.html#gtk-init">gtk_init</a></span><span class="symbol">(</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">argc</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">argv </span><span class="symbol">);</span>
<span class="normal">  win </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkWindow.html#gtk-window-new">gtk_window_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="gtk-Standard-Enumerations.html#GTK-WINDOW-TOPLEVEL:CAPS">GTK_WINDOW_TOPLEVEL</a></span><span class="symbol">);</span>
<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect">g_signal_connect</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">win</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"delete-event"</span><span class="symbol">,</span>
<span class="normal">                    </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="gtk-General.html#gtk-true">gtk_true</a></span><span class="symbol">),</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect">g_signal_connect</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">win</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"destroy"</span><span class="symbol">,</span>
<span class="normal">            </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="gtk-General.html#gtk-main-quit">gtk_main_quit</a></span><span class="symbol">),</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="normal">  but </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkButton.html#gtk-button-new-with-label">gtk_button_new_with_label</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Close yourself. I mean it!"</span><span class="symbol">);</span>
<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect-swapped">g_signal_connect_swapped</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">but</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"clicked"</span><span class="symbol">,</span>
<span class="normal">          </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="GtkObject.html#gtk-object-destroy">gtk_object_destroy</a></span><span class="symbol">),</span><span class="normal"> win</span><span class="symbol">);</span>
<span class="normal">  </span><span class="function"><a href="GtkContainer.html#gtk-container-add">gtk_container_add</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_CONTAINER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">win</span><span class="symbol">),</span><span class="normal"> but</span><span class="symbol">);</span>
<span class="normal">  </span><span class="function"><a href="GtkWidget.html#gtk-widget-show-all">gtk_widget_show_all</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">win</span><span class="symbol">);</span>
<span class="normal">  </span><span class="function"><a href="gtk-General.html#gtk-main">gtk_main</a></span><span class="normal"> </span><span class="symbol">();</span>
<span class="normal">  </span><span class="keyword">return</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span>
<span class="cbracket">}</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

</div>
<br class="example-break"><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a></td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-false"></a><h3>gtk_false ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_false                           (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Analogical to <a class="link" href="gtk-General.html#gtk-true" title="gtk_true ()"><code class="function">gtk_true()</code></a> this function does nothing
but always returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a></td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-grab-add"></a><h3>gtk_grab_add ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_grab_add                        (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>
Makes <em class="parameter"><code>widget</code></em> the current grabbed widget. This means that interaction with
other widgets in the same application is blocked and mouse as well as
keyboard events are delivered to this widget.
</p>
<p>
If <em class="parameter"><code>widget</code></em> is not sensitive, it is not set as the current grabbed
widget and this function does nothing.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
<td>The widget that grabs keyboard and pointer events.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-grab-get-current"></a><h3>gtk_grab_get_current ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_grab_get_current                (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Queries the current grab of the default window group.
</p>
<p>
Queries the current grab of the default window group.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The widget which currently
has the grab or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no grab is active. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-grab-remove"></a><h3>gtk_grab_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_grab_remove                     (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>
Removes the grab from the given widget. You have to pair calls to <a class="link" href="gtk-General.html#gtk-grab-add" title="gtk_grab_add ()"><code class="function">gtk_grab_add()</code></a>
and <a class="link" href="gtk-General.html#gtk-grab-remove" title="gtk_grab_remove ()"><code class="function">gtk_grab_remove()</code></a>.
</p>
<p>
If <em class="parameter"><code>widget</code></em> does not have the grab, this function does nothing.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
<td>The widget which gives up the grab.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-init-add"></a><h3>gtk_init_add ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_init_add                        (<em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_init_add</code> is deprecated and should not be used in newly-written code. This function is going to be removed in GTK+ 3.0</p>
</div>
<p>
Registers a function to be called when the mainloop is started.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>Function to invoke when <a class="link" href="gtk-General.html#gtk-main" title="gtk_main ()"><code class="function">gtk_main()</code></a> is called next.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>Data to pass to that function.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-quit-add-destroy"></a><h3>gtk_quit_add_destroy ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_quit_add_destroy                (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> main_level</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_quit_add_destroy</code> is deprecated and should not be used in newly-written code. This function is going to be removed in GTK+ 3.0</p>
</div>
<p>
Trigger destruction of <em class="parameter"><code>object</code></em> in case the mainloop at level <em class="parameter"><code>main_level</code></em>
is quit.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>main_level</code></em> :</span></p></td>
<td>Level of the mainloop which shall trigger the destruction.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
<td>Object to be destroyed.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-quit-add"></a><h3>gtk_quit_add ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_quit_add                        (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> main_level</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_quit_add</code> is deprecated and should not be used in newly-written code. This function is going to be removed in GTK+ 3.0</p>
</div>
<p>
Registers a function to be called when an instance of the mainloop is left.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>main_level</code></em> :</span></p></td>
<td>Level at which termination the function shall be called. You
can pass 0 here to have the function run at the termination of the current
mainloop.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call. This should return 0 to be removed from the
list of quit handlers. Otherwise the function might be called again.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>Pointer to pass when calling <em class="parameter"><code>function</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A handle for this quit handler (you need this for <a class="link" href="gtk-General.html#gtk-quit-remove" title="gtk_quit_remove ()"><code class="function">gtk_quit_remove()</code></a>)
or 0 if you passed a <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> pointer in <em class="parameter"><code>function</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-quit-add-full"></a><h3>gtk_quit_add_full ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_quit_add_full                   (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> main_level</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()"><span class="type">GtkCallbackMarshal</span></a> marshal</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_quit_add_full</code> is deprecated and should not be used in newly-written code. This function is going to be removed in GTK+ 3.0</p>
</div>
<p>
Registers a function to be called when an instance of the mainloop is left.
In comparison to <a class="link" href="gtk-General.html#gtk-quit-add" title="gtk_quit_add ()"><code class="function">gtk_quit_add()</code></a> this function adds the possibility to
pass a marshaller and a function to be called when the quit handler is freed.
</p>
<p>
The former can be used to run interpreted code instead of a compiled function
while the latter can be used to free the information stored in <em class="parameter"><code>data</code></em> (while
you can do this in <em class="parameter"><code>function</code></em> as well)... So this function will mostly be
used by GTK+ wrappers for languages other than C.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>main_level</code></em> :</span></p></td>
<td>Level at which termination the function shall be called. You
can pass 0 here to have the function run at the termination of the current
mainloop.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call. This should return 0 to be removed from the
list of quit handlers. Otherwise the function might be called again.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>marshal</code></em> :</span></p></td>
<td>The marshaller to be used. If this is non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, <em class="parameter"><code>function</code></em> is
ignored.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>Pointer to pass when calling <em class="parameter"><code>function</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td>Function to call to destruct <em class="parameter"><code>data</code></em>. Gets <em class="parameter"><code>data</code></em> as argument.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A handle for this quit handler (you need this for <a class="link" href="gtk-General.html#gtk-quit-remove" title="gtk_quit_remove ()"><code class="function">gtk_quit_remove()</code></a>)
or 0 if you passed a <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> pointer in <em class="parameter"><code>function</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-quit-remove"></a><h3>gtk_quit_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_quit_remove                     (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> quit_handler_id</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_quit_remove</code> is deprecated and should not be used in newly-written code. This function is going to be removed in GTK+ 3.0</p>
</div>
<p>
Removes a quit handler by its identifier.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>quit_handler_id</code></em> :</span></p></td>
<td>Identifier for the handler returned when installing it.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-quit-remove-by-data"></a><h3>gtk_quit_remove_by_data ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_quit_remove_by_data             (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_quit_remove_by_data</code> is deprecated and should not be used in newly-written code. This function is going to be removed in GTK+ 3.0</p>
</div>
<p>
Removes a quit handler identified by its <em class="parameter"><code>data</code></em> field.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>The pointer passed as <em class="parameter"><code>data</code></em> to <a class="link" href="gtk-General.html#gtk-quit-add" title="gtk_quit_add ()"><code class="function">gtk_quit_add()</code></a> or <a class="link" href="gtk-General.html#gtk-quit-add-full" title="gtk_quit_add_full ()"><code class="function">gtk_quit_add_full()</code></a>.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-timeout-add-full"></a><h3>gtk_timeout_add_full ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_timeout_add_full                (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> interval</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()"><span class="type">GtkCallbackMarshal</span></a> marshal</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_timeout_add_full</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-timeout-add-full"><code class="function">g_timeout_add_full()</code></a> instead.</p>
</div>
<p>
Registers a function to be called periodically. The function will be called
repeatedly after <em class="parameter"><code>interval</code></em> milliseconds until it returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> at which
point the timeout is destroyed and will not be called again.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>interval</code></em> :</span></p></td>
<td>The time between calls to the function, in milliseconds
(1/1000ths of a second.)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call periodically.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>marshal</code></em> :</span></p></td>
<td>The marshaller to use instead of the function (if non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>The data to pass to the function.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td>Function to call when the timeout is destroyed or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A unique id for the event source.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-timeout-add"></a><h3>gtk_timeout_add ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_timeout_add                     (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> interval</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_timeout_add</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-timeout-add"><code class="function">g_timeout_add()</code></a> instead.</p>
</div>
<p>
Registers a function to be called periodically. The function will be called
repeatedly after <em class="parameter"><code>interval</code></em> milliseconds until it returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> at which
point the timeout is destroyed and will not be called again.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>interval</code></em> :</span></p></td>
<td>The time between calls to the function, in milliseconds
(1/1000ths of a second.)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call periodically.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>The data to pass to the function.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A unique id for the event source.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-timeout-remove"></a><h3>gtk_timeout_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_timeout_remove                  (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> timeout_handler_id</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_timeout_remove</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-source-remove"><code class="function">g_source_remove()</code></a> instead.</p>
</div>
<p>
Removes the given timeout destroying all information about it.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>timeout_handler_id</code></em> :</span></p></td>
<td>The identifier returned when installing the timeout.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-idle-add"></a><h3>gtk_idle_add ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_idle_add                        (<em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_idle_add</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-idle-add"><code class="function">g_idle_add()</code></a> instead.</p>
</div>
<p>
Causes the mainloop to call the given function whenever no events with
higher priority are to be processed. The default priority is
<a class="link" href="gtk-General.html#GTK-PRIORITY-DEFAULT:CAPS" title="GTK_PRIORITY_DEFAULT"><code class="literal">GTK_PRIORITY_DEFAULT</code></a>, which is rather low.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>The information to pass to the function.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a unique handle for this registration.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-idle-add-priority"></a><h3>gtk_idle_add_priority ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_idle_add_priority               (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> priority</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_idle_add_priority</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-idle-add-full"><code class="function">g_idle_add_full()</code></a> instead.</p>
</div>
<p>
Like <a class="link" href="gtk-General.html#gtk-idle-add" title="gtk_idle_add ()"><code class="function">gtk_idle_add()</code></a> this function allows you to have a function called
when the event loop is idle. The difference is that you can give a
priority different from <a class="link" href="gtk-General.html#GTK-PRIORITY-DEFAULT:CAPS" title="GTK_PRIORITY_DEFAULT"><code class="literal">GTK_PRIORITY_DEFAULT</code></a> to the idle function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>priority</code></em> :</span></p></td>
<td>The priority which should not be above <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-HIGH-IDLE:CAPS"><code class="literal">G_PRIORITY_HIGH_IDLE</code></a>.
Note that you will interfere with GTK+ if you use a priority above
<a class="link" href="gtk-General.html#GTK-PRIORITY-RESIZE:CAPS" title="GTK_PRIORITY_RESIZE"><code class="literal">GTK_PRIORITY_RESIZE</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>Data to pass to that function.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A unique id for the event source.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-idle-add-full"></a><h3>gtk_idle_add_full ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_idle_add_full                   (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> priority</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkFunction" title="GtkFunction ()"><span class="type">GtkFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()"><span class="type">GtkCallbackMarshal</span></a> marshal</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_idle_add_full</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-idle-add-full"><code class="function">g_idle_add_full()</code></a> instead.</p>
</div>
<p>
Like <a class="link" href="gtk-General.html#gtk-idle-add" title="gtk_idle_add ()"><code class="function">gtk_idle_add()</code></a> this function allows you to have a function called
when the event loop is idle. The difference is that you can give a
priority different from <a class="link" href="gtk-General.html#GTK-PRIORITY-DEFAULT:CAPS" title="GTK_PRIORITY_DEFAULT"><code class="literal">GTK_PRIORITY_DEFAULT</code></a> to the idle function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>priority</code></em> :</span></p></td>
<td>The priority which should not be above <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-HIGH-IDLE:CAPS"><code class="literal">G_PRIORITY_HIGH_IDLE</code></a>.
Note that you will interfere with GTK+ if you use a priority above
<a class="link" href="gtk-General.html#GTK-PRIORITY-RESIZE:CAPS" title="GTK_PRIORITY_RESIZE"><code class="literal">GTK_PRIORITY_RESIZE</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>marshal</code></em> :</span></p></td>
<td>The marshaller to use instead of the function (if non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>Data to pass to that function.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td>Function to call when the timeout is destroyed or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A unique id for the event source.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-idle-remove"></a><h3>gtk_idle_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_idle_remove                     (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> idle_handler_id</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_idle_remove</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-source-remove"><code class="function">g_source_remove()</code></a> instead.</p>
</div>
<p>
Removes the idle function with the given id.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>idle_handler_id</code></em> :</span></p></td>
<td>Identifies the idle function to remove.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-idle-remove-by-data"></a><h3>gtk_idle_remove_by_data ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_idle_remove_by_data             (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_idle_remove_by_data</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-idle-remove-by-data"><code class="function">g_idle_remove_by_data()</code></a> instead.</p>
</div>
<p>
Removes the idle function identified by the user data.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>remove the idle function which was registered with this user data.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-input-add-full"></a><h3>gtk_input_add_full ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_input_add_full                  (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> source</code></em>,
                                                         <em class="parameter"><code><a href="../gdk/gdk-Input.html#GdkInputCondition"><span class="type">GdkInputCondition</span></a> condition</code></em>,
                                                         <em class="parameter"><code><a href="../gdk/gdk-Input.html#GdkInputFunction"><span class="type">GdkInputFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()"><span class="type">GtkCallbackMarshal</span></a> marshal</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_input_add_full</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#g-io-add-watch-full"><code class="function">g_io_add_watch_full()</code></a> instead.</p>
</div>
<p>
Registers a function to be called when a condition becomes true
on a file descriptor.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
<td>a file descriptor.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>condition</code></em> :</span></p></td>
<td>the condition.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>The function to call.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>marshal</code></em> :</span></p></td>
<td>The marshaller to use instead of the function (if non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>callback data passed to <em class="parameter"><code>function</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td>callback function to call with <em class="parameter"><code>data</code></em> when the input
handler is removed, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A unique id for the event source; to be used with <a class="link" href="gtk-General.html#gtk-input-remove" title="gtk_input_remove ()"><code class="function">gtk_input_remove()</code></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-input-remove"></a><h3>gtk_input_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_input_remove                    (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> input_handler_id</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_input_remove</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-source-remove"><code class="function">g_source_remove()</code></a> instead.</p>
</div>
<p>
Removes the function with the given id.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>input_handler_id</code></em> :</span></p></td>
<td>Identifies the function to remove.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GTK-PRIORITY-REDRAW:CAPS"></a><h3>GTK_PRIORITY_REDRAW</h3>
<pre class="programlisting">#define GTK_PRIORITY_REDRAW     (G_PRIORITY_HIGH_IDLE + 20)
</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GTK_PRIORITY_REDRAW</code> has been deprecated since version 2.4 and should not be used in newly-written code. This macro is deprecated. You should use <a href="../gdk/gdk-Events.html#GDK-PRIORITY-REDRAW:CAPS"><code class="literal">GDK_PRIORITY_REDRAW</code></a> instead.</p>
</div>
<p>
Use this priority for redrawing related stuff. It is used internally by
GTK+ to do pending redraws. This priority is lower than <a class="link" href="gtk-General.html#GTK-PRIORITY-RESIZE:CAPS" title="GTK_PRIORITY_RESIZE"><code class="literal">GTK_PRIORITY_RESIZE</code></a>
to avoid redrawing a widget just before resizing (and therefore redrawing
it again).
</p>
</div>
<hr>
<div class="refsect2">
<a name="GTK-PRIORITY-RESIZE:CAPS"></a><h3>GTK_PRIORITY_RESIZE</h3>
<pre class="programlisting">#define GTK_PRIORITY_RESIZE     (G_PRIORITY_HIGH_IDLE + 10)
</pre>
<p>
Use this priority for resizing related stuff. It is used internally by
GTK+ to compute the sizes of widgets. This priority is higher than
<a class="link" href="gtk-General.html#GTK-PRIORITY-REDRAW:CAPS" title="GTK_PRIORITY_REDRAW"><code class="literal">GTK_PRIORITY_REDRAW</code></a> to avoid resizing a widget which was just redrawn.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GTK-PRIORITY-HIGH:CAPS"></a><h3>GTK_PRIORITY_HIGH</h3>
<pre class="programlisting">#define GTK_PRIORITY_HIGH       G_PRIORITY_HIGH
</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GTK_PRIORITY_HIGH</code> has been deprecated since version 2.4 and should not be used in newly-written code. This macro is deprecated. You should use <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-HIGH:CAPS"><code class="literal">G_PRIORITY_HIGH</code></a> instead.</p>
</div>
<p>
Use this for high priority timeouts. This priority is never used inside
GTK+ so everything running at this priority will be running before anything
inside the toolkit.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GTK-PRIORITY-INTERNAL:CAPS"></a><h3>GTK_PRIORITY_INTERNAL</h3>
<pre class="programlisting">#define GTK_PRIORITY_INTERNAL   GTK_PRIORITY_REDRAW
</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GTK_PRIORITY_INTERNAL</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
This priority is for GTK+ internal stuff. Don't use it in your applications.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GTK-PRIORITY-DEFAULT:CAPS"></a><h3>GTK_PRIORITY_DEFAULT</h3>
<pre class="programlisting">#define GTK_PRIORITY_DEFAULT G_PRIORITY_DEFAULT_IDLE
</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GTK_PRIORITY_DEFAULT</code> has been deprecated since version 2.4 and should not be used in newly-written code. This macro is deprecated. You should use <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-DEFAULT-IDLE:CAPS"><code class="literal">G_PRIORITY_DEFAULT_IDLE</code></a> instead.</p>
</div>
<p>
Default priority for idle functions.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GTK-PRIORITY-LOW:CAPS"></a><h3>GTK_PRIORITY_LOW</h3>
<pre class="programlisting">#define GTK_PRIORITY_LOW G_PRIORITY_LOW
</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GTK_PRIORITY_LOW</code> has been deprecated since version 2.4 and should not be used in newly-written code. This macro is deprecated. You should use <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-LOW:CAPS"><code class="literal">G_PRIORITY_LOW</code></a> instead.</p>
</div>
<p>
Priority for very unimportant background tasks.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-key-snooper-install"></a><h3>gtk_key_snooper_install ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_key_snooper_install             (<em class="parameter"><code><a class="link" href="gtk-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()"><span class="type">GtkKeySnoopFunc</span></a> snooper</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> func_data</code></em>);</pre>
<p>
Installs a key snooper function, which will get called on all key events
before delivering them normally.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>snooper</code></em> :</span></p></td>
<td>a <a class="link" href="gtk-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()"><span class="type">GtkKeySnoopFunc</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func_data</code></em> :</span></p></td>
<td>data to pass to <em class="parameter"><code>snooper</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a unique id for this key snooper for use with <a class="link" href="gtk-General.html#gtk-key-snooper-remove" title="gtk_key_snooper_remove ()"><code class="function">gtk_key_snooper_remove()</code></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GtkKeySnoopFunc"></a><h3>GtkKeySnoopFunc ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                (*GtkKeySnoopFunc)                  (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *grab_widget</code></em>,
                                                         <em class="parameter"><code><a href="../gdk/gdk-Event-Structures.html#GdkEventKey"><span class="type">GdkEventKey</span></a> *event</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> func_data</code></em>);</pre>
<p>
Key snooper functions are called before normal event delivery.
They can be used to implement custom key event handling.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>grab_widget</code></em> :</span></p></td>
<td>the widget to which the event will be delivered.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td>
<td>the key event.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func_data</code></em> :</span></p></td>
<td>the <em class="parameter"><code>func_data</code></em> supplied to <a class="link" href="gtk-General.html#gtk-key-snooper-install" title="gtk_key_snooper_install ()"><code class="function">gtk_key_snooper_install()</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to stop further processing of <em class="parameter"><code>event</code></em>, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> to continue.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-key-snooper-remove"></a><h3>gtk_key_snooper_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_key_snooper_remove              (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> snooper_handler_id</code></em>);</pre>
<p>
Removes the key snooper function with the given id.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>snooper_handler_id</code></em> :</span></p></td>
<td>Identifies the key snooper to remove.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-get-current-event"></a><h3>gtk_get_current_event ()</h3>
<pre class="programlisting"><a href="../gdk/gdk-Event-Structures.html#GdkEvent"><span class="returnvalue">GdkEvent</span></a> *          gtk_get_current_event               (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Obtains a copy of the event currently being processed by GTK+.  For
example, if you get a "clicked" signal from <a class="link" href="GtkButton.html" title="GtkButton"><span class="type">GtkButton</span></a>, the current
event will be the <a href="../gdk/gdk-Event-Structures.html#GdkEventButton"><span class="type">GdkEventButton</span></a> that triggered the "clicked"
signal. The returned event must be freed with <a href="../gdk/gdk-Events.html#gdk-event-free"><code class="function">gdk_event_free()</code></a>.
If there is no current event, the function returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a copy of the current event, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no
current event. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-get-current-event-time"></a><h3>gtk_get_current_event_time ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a>             gtk_get_current_event_time          (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
If there is a current event and it has a timestamp, return that
timestamp, otherwise return <a href="../gdk/gdk-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the timestamp from the current event, or <a href="../gdk/gdk-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a>.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-get-current-event-state"></a><h3>gtk_get_current_event_state ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_get_current_event_state         (<em class="parameter"><code><a href="../gdk/gdk-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> *state</code></em>);</pre>
<p>
If there is a current event and it has a state field, place
that state field in <em class="parameter"><code>state</code></em> and return <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, otherwise return
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
<td>a location to store the state of the current event. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if there was a current event and it had a state field</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-get-event-widget"></a><h3>gtk_get_event_widget ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_get_event_widget                (<em class="parameter"><code><a href="../gdk/gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>);</pre>
<p>
If <em class="parameter"><code>event</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> or the event was not associated with any widget,
returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, otherwise returns the widget that received the event
originally.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td>
<td>a <a href="../gdk/gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the widget that originally
received <em class="parameter"><code>event</code></em>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-propagate-event"></a><h3>gtk_propagate_event ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_propagate_event                 (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
                                                         <em class="parameter"><code><a href="../gdk/gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>);</pre>
<p>
Sends an event to a widget, propagating the event to parent widgets
if the event remains unhandled. Events received by GTK+ from GDK
normally begin in <a class="link" href="gtk-General.html#gtk-main-do-event" title="gtk_main_do_event ()"><code class="function">gtk_main_do_event()</code></a>. Depending on the type of
event, existence of modal dialogs, grabs, etc., the event may be
propagated; if so, this function is used. <a class="link" href="gtk-General.html#gtk-propagate-event" title="gtk_propagate_event ()"><code class="function">gtk_propagate_event()</code></a>
calls <a class="link" href="GtkWidget.html#gtk-widget-event" title="gtk_widget_event ()"><code class="function">gtk_widget_event()</code></a> on each widget it decides to send the
event to.  So <a class="link" href="GtkWidget.html#gtk-widget-event" title="gtk_widget_event ()"><code class="function">gtk_widget_event()</code></a> is the lowest-level function; it
simply emits the "event" and possibly an event-specific signal on a
widget.  <a class="link" href="gtk-General.html#gtk-propagate-event" title="gtk_propagate_event ()"><code class="function">gtk_propagate_event()</code></a> is a bit higher-level, and
<a class="link" href="gtk-General.html#gtk-main-do-event" title="gtk_main_do_event ()"><code class="function">gtk_main_do_event()</code></a> is the highest level.
</p>
<p>
All that said, you most likely don't want to use any of these
functions; synthesizing events is rarely needed. Consider asking on
the mailing list for better ways to achieve your goals. For
example, use <a href="../gdk/gdk-Windows.html#gdk-window-invalidate-rect"><code class="function">gdk_window_invalidate_rect()</code></a> or
<a class="link" href="GtkWidget.html#gtk-widget-queue-draw" title="gtk_widget_queue_draw ()"><code class="function">gtk_widget_queue_draw()</code></a> instead of making up expose events.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td>
<td>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td>
<td>an event</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="gtk-General.see-also"></a><h2>See Also</h2>
<p>
See the GLib manual, especially <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a> and signal-related
functions such as <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect"><code class="function">g_signal_connect()</code></a>.
</p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>